package com.vecspace.database.model;

public class DataColumn implements Cloneable{
	private String columnName;
	private String columnCaption;
	private int dataType;
	private String sourceColumnName;//原始字段名（转置前的字段名）
	public DataColumn(){
		
	}
	
	public DataColumn(String columnName){
		this.columnName = columnName;
	}
	

	public DataColumn(String columnName, String columnCaption){
		this.columnName = columnName;
		this.columnCaption = columnCaption;
	}
	

	public DataColumn(String columnName, String columnCaption, int dataType){
		this.columnName = columnName;
		this.columnCaption = columnCaption;
		this.dataType = dataType;
	}
	

	public DataColumn(String columnName, int dataType){
		this.columnName = columnName;
		this.dataType = dataType;
	}

	public String getColumnName() {
		return columnName;
	}

	public void setColumnName(String columnName) {
		this.columnName = columnName;
	}

	public String getColumnCaption() {
		return columnCaption;
	}
	
	public String getDisplayCaption() {
		if(columnCaption != null && columnCaption.length() >0) {
			return columnCaption;
		}
		else {
			return columnName;
		}
	}
	
	

	public void setColumnCaption(String columnCaption) {
		this.columnCaption = columnCaption;
	}

	public int getDataType() {
		return dataType;
	}

	public void setDataType(int dataType) {
		this.dataType = dataType;
	}
	
	public String getSourceColumnName() {
		return sourceColumnName;
	}

	public void setSourceColumnName(String sourceColumnName) {
		this.sourceColumnName = sourceColumnName;
	}

	@Override
	public DataColumn clone(){
		DataColumn other = new DataColumn(columnName, columnCaption, dataType);
		other.sourceColumnName = this.sourceColumnName;
		return other;
	}
}
